package com.ssm.serviceImpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ssm.dao.JobEntityMapper;
import com.ssm.dao.ResumeEntityMapper;
import com.ssm.entity.ResumeEntityWithBLOBs;
import com.ssm.service.ResumeService;

@Service("ResumeServiceImpl")
@Transactional
public class ResumeServiceImpl implements ResumeService{
	
    @Autowired
    private ResumeEntityMapper mapper;

	@Override
	public void save(ResumeEntityWithBLOBs resume) {
		mapper.insert(resume);
		return;
	}

	@Override
	public boolean update(ResumeEntityWithBLOBs resume) {
		try {
			int result = mapper.updateByPrimaryKeySelective(resume);
			System.out.print(result);
			return true;
		} catch (Exception e) {
			return false;
		}
	}

	@Override
	public boolean delete(String id) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public ResumeEntityWithBLOBs findById(String id) {
		// TODO Auto-generated method stub
		return mapper.selectByPrimaryKey(id);
	}

	@Override
	public ResumeEntityWithBLOBs findByStudent(String stuId) {
		// TODO Auto-generated method stub
		return mapper.selectByStudentId(stuId);
	}
}
